<html>
<head>
<title>RCS Library Version Functions</title>
</head>
<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="551A8B" ALINK="#FF0000">
<H1>RCS Version Functions</h1>
<H2>Version numbers</H2>
<p>The RCS versions numbers are 2 decimal numbers separated by a 
decimal point. For example iin &quot;2.7&quot;, the major version number is
2 and the minor version number is 7. If two programs communicate there should
be no problem if the versions of RCS used differ only by
a minor version number, but if they differ by a major version number then it
is likely that one or both programs may need to be updated.</p>
<H2>C++ Functions</h2>
<p>There are several ways that programmers can test the RCS version.</p>
<h3>RCS_VERSION</h3>
<p>RCS_VERSION is a macro defined in rcs.hh, of the form &quot;m.n&quot, 
where m is the major version number and n is minor version number.</p>
<h3>print_rcs_version</h3>
<p>This function prints a line describing the RCS library, it's version,
date compiled etc.</p>
<h3>rcs_version_compare</h3>
<pre>
int rcs_version_compare(const char * compversion);
</pre>
<p>
This function allows users to determine if the RCS library linked in
is newer or older than a particular version.
It returns 0 if the version matches, -1 if the RCS library linked in 
is older than compversion, and +1 if the RCS library linked in 
is newer than compversion.
If no minor number is included in compversion any version with the 
given major number will return 0.
<h4>Example 1:</h4>
<pre>
main()
{
	if(rcs_version_compare("2.5") < 0)
	{
		printf("RCS library older than 2.5\n");
	}
}
</pre>
<h4>Example 2:</h4>
<pre>
// This example shows how to test if the rcs.hh included matches the
// library that is linked in.
main()
{
	if(rcs_version_compare(RCS_VERSION) != 0)
	{
		printf("RCS library and header file don't match.\n");
	}
}
<h4>Example 2:</h4>
<pre>
// Only compare major number.
main()
{
	if(rcs_version_compare("2") != 0)
	{
		printf("RCS library is not version 2.\n");
	}
	else
	{
		printf("RCS library is version 2. (It could be 2.0 or 2.99, we don't care.)\n");
	}

}

</p>
<h3>Using What to determine the Version</h3>
The SCCS what command can be used to determine the version of
the library linked into an executable.
<pre>
	what executable_file | grep RCS_LIBRARY_VERSION

output:
        RCS_LIBRARY_VERSION: 2.9 Compiled on  May  6 1997 at 15:55:35 for the  sunos5 platform.


</pre>

<h3>Java Functions</h3>
<p>Not Implemented yet.</p>
<h3>See Also</h3>
<A HREF="mods.html">The list of modifications.</a>

</body>
</html>
